package com.ibeeking.found.content.api.feign;

import com.ibeeking.found.content.api.common.dto.MemberInfoDTO;
import com.ibeeking.found.content.api.feign.fallback.ContentMemberCFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Set;

/**
 * @Author ibeeking
 */
@FeignClient(name = "mall-member-c-server", path = "/c", contextId = "contentMemberCClient", fallbackFactory = ContentMemberCFallbackFactory.class, decode404 = true)
public interface ContentMemberCClient {

    /**
     * 通过会员id查询会员信息
     *
     * @param id
     * @return
     */
    @PostMapping(value = "/member/feign/v1/infoOne/{id}")
    ResponseResult<MemberInfoDTO> infoOne(@PathVariable("id") Long id);

    /**
     * 根据会员手机号查询会员
     *
     * @param phone
     * @return
     */
    @PostMapping(value = "/member/feign/v1/infoOneByPhone/{phone}")
    ResponseResult<MemberInfoDTO> infoOneByPhone(@PathVariable("phone") String phone);

    /**
     * 会员信息
     *
     * @param ids
     * @return
     */
    @PostMapping(value = "/member/feign/v1/infoList")
    ResponseResult<List<MemberInfoDTO>> infoList(@RequestBody Set<Long> ids);

}
